<?php

namespace common\models\byxcx;

use Yii;

use common\helpers\StringHelper;

/**
 * This is the model class for table "{{%addon_example_curd}}".
 *
 * @property string $id ID
 * @property string $name 姓名
 * @property string $position 职位
 * @property string $cover 图片
 * @property string $description 描述
 * @property int $status 状态
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 */
class team extends \common\models\base\BaseModel
{


    public $province_ids;
    public $city_ids;
    public $area_ids;

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%byxcx_team}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [
                [
                    'status',
                    'cate_id',
                    'created_at',
                    'updated_at',
                ],
                'integer',
            ],
            [['name','cover'], 'required'],
            [['name'], 'string', 'max' => 50],
            [['position'], 'string', 'max' => 60],
            [['cover',], 'string', 'max' => 100],
            [['description'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name'=>'姓名',
            'position'=>'职位',
            'cate_id' => '分类ID',
            'cover' => '图片',
            'description' => '简介',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
    /**
     * 关联当前用户
     *
     * @return \yii\db\ActiveQuery
     */
    public function getCate()
    {
        return $this->hasOne(Cate::class, ['id' => 'cate_id']);
    }


}
